﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SimpleDetailBase.ascx.cs" Inherits="DemoExtNet.Base.SimpleDetailBase" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Register Assembly="Enterprise" Namespace="Enterprise.Web.Controls" TagPrefix="etc" %>
<ext:XScript ID="XScipt1" runat="server">
    <script type="text/javascript">
        function ConfirmDeleteToChuc() {
            Ext.MessageBox.confirm('Thông báo', 'Bạn có chắc chắn xóa record này ko?', function doDel2(btn) {
                if (btn == 'yes') {
                    #{DirectMethods}.DoDelete();
                }
            });
        }
    </script>
</ext:XScript>
<etc:XWindow ID="wdSimpleDetail" runat="server" Width="505" Icon="User" Hidden="true" >
    <Items>
       <etc:XFormDetail ID="FormPanel1" runat="server" LabelWidth="150">
           <Items>
               <ext:Hidden ID="__Id" runat="server"></ext:Hidden>
               <ext:TextField ID="txtShortName" runat="server" Width="300" FieldLabel=" Tên tổ chức (Short)" />
               <ext:TextField ID="txtFullName" runat="server" Width="300" FieldLabel=" Tên tổ chức (Full)"
                   AllowBlank="false" MsgTarget="Side" />
               <etc:XLookup ID="cbbXepHang" runat="server" FieldLabel=" Xếp hạng đơn vị" Width="300"
                   AllowBlank="false" MsgTarget="Side" 
                   SelectMethod="GetXepHangDonVi"
                   TypeName="Viewer.BusinessObject.BusinessEntities.CommonCode,DemoExtNet" 
                   AutoLoad="false" />
               <etc:XLookup ID="cbbKhoi" runat="server" FieldLabel="Khối quản lí" Width="300" 
                   AllowBlank="false" MsgTarget="Side" 
                   SelectMethod="GetKhoiQuanlyToChuc"
                   TypeName="Viewer.BusinessObject.BusinessEntities.CommonCode,DemoExtNet" 
                   AutoLoad="false"/>
               <etc:XLookup ID="cboLoaiToChuc" runat="server" FieldLabel="Loại tổ chức" Width="300"
                   AllowBlank="false" MsgTarget="Side" 
                   SelectMethod="GetLoaiToChuc"
                   TypeName="Viewer.BusinessObject.BusinessEntities.CommonCode,DemoExtNet" 
                   AutoLoad="false" />
               <ext:TextField ID="txtGhiChu" runat="server" Width="300" FieldLabel=" Ghi chú" />
           </Items>
       </etc:XFormDetail>
    </Items>
     <TopBar>
        <ext:Toolbar ID="Toolbar1" runat="server"> 
            <Items>
                <ext:ToolbarFill ID="ToolbarFill1" runat="server" />
                <ext:Button ID="btnEdit" runat="server" Text="Sửa" Icon="NoteEdit"  OnDirectClick="OnClick_Edit"></ext:Button>
                <ext:Button ID="btnCreate" runat="server" Text="Tạo Mới" Icon="NoteAdd"  OnDirectClick="OnClick_Create"></ext:Button>
                <ext:Button ID="btnCopy" runat="server" Text="Copy" Icon="NoteGo"  OnDirectClick="OnClick_Copy"></ext:Button>
                <ext:Button ID="btnDelete" runat="server" Text="Xóa" Icon="NoteDelete"  >
                    <Listeners>
                        <Click Handler="ConfirmDeleteToChuc();" />
                    </Listeners>
                </ext:Button>
            </Items>
        </ext:Toolbar>
    </TopBar>
    <Buttons>
        <ext:Button ID="btnClose" runat="server" Text="Đóng" Icon="Cancel" />
        <ext:Button ID="btnSave" runat="server" Text="Lưu" Icon="Disk" OnDirectClick="OnClick_Save">
            <Listeners>
                <Click Handler="if (#{FormPanel1}.getForm().isValid()) {}else{global.ShowMessageFormIsInValid(); return false;}" />
            </Listeners>
        </ext:Button>
    </Buttons>
</etc:XWindow>
